#!/usr/bin/env python3
import sys
 
# 要验证的库列表
libs = [
    "time", "json", "sys", "copy", "re", "os", 
    "threading", "subprocess", "argparse", "logging", 
    "shutil", "socket", "curses", "datetime", "typing"
]
 
# 特殊情况：requests 不是标准库，需单独处理
optional_libs = ["requests"]
 
print(f"Python 版本: {sys.version.split()[0]}")
print("正在验证标准库...")
 
# 验证标准库
for lib in libs:
    try:
        if lib == "datetime":
            from datetime import datetime
            print(f"✓ {lib}.datetime 导入成功")
        elif lib == "typing":
            from typing import List, Tuple
            print(f"✓ {lib}.List/Tuple 导入成功")
        else:
            __import__(lib)
            print(f"✓ {lib} 导入成功")
    except ImportError as e:
        print(f"✗ {lib} 导入失败: {e}")
 
print("\n验证第三方库...")
for lib in optional_libs:
    try:
        __import__(lib)
        print(f"✓ {lib} 导入成功（需单独安装）")
    except ImportError:
        print(f"✗ {lib} 未安装（非标准库，需 pip install {lib}）")
